# src/utils.py

import torch
import os

def save_checkpoint(state, filename="my_checkpoint.pth.tar"):
    """
    Saves model checkpoint.
    
    Args:
        state: The model state dictionary to save
        filename: Path to save the checkpoint
    """
    print("=> Saving checkpoint")
    # Ensure directory exists
    os.makedirs(os.path.dirname(filename), exist_ok=True)
    torch.save(state, filename)

# You can add other utility functions here, e.g., for plotting results.


